﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Vision.AlgBase
{
    /// <summary>
    /// 运行结果
    /// </summary>
    [Serializable]
    public enum RunStatus : int
    {
        /// <summary>
        /// 未开始
        /// </summary>
        UnStart = -1,
        /// <summary>
        /// 运行成功
        /// </summary>
        Success = 0,
        /// <summary>
        /// 正在运行
        /// </summary>
        Running,
        /// <summary>
        /// 运行失败
        /// </summary>
        Fail,
    }


    /// <summary>
    /// 指令接口基类
    /// </summary>
    public interface IAlg :  INotifyPropertyChanged, ICloneable
    {
        /// <summary>
        /// 运行
        /// </summary>
        /// <returns></returns>
        bool Run();

        /// <summary>
        /// 工具名称
        /// </summary>
        string Name { get; set; }

        /// <summary>
        /// 运行状态
        /// </summary>
        [field: NonSerialized,Browsable(false)]
        RunStatus ToolRunStatus { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        bool IsEnable { get; set; }

        /// <summary>
        /// 运行时间
        /// </summary>
        [field: NonSerialized]
        long RunTime { get; }
    }
}
